package site.taote.sboot.framework.configures;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *
 */
@Configuration
public class SbootWebMvcConfigure implements WebMvcConfigurer {

    private Logger log = LoggerFactory.getLogger(SbootWebMvcConfigure.class);
    /**
     * 全局拦截器配置
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        log.info("拦截器添加！！！！");
    }

    /**
     * 跨域访问配置
     * @param registry
     */
    @Override
    public void addCorsMappings(CorsRegistry registry) {

    }

    /**
     * 格式化配置
     * @param registry
     */
    @Override
    public void addFormatters(FormatterRegistry registry) {
        //对Controller参数进行格式化，比如时间格式化
    }

   /**  
    * 视图配置
    * @author taote  
    * @date 2018/4/15 7:56
    * @param [registry]  
    * @return void  
    */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {

    }
}
